
#include <string.h>
#include <stdio.h>
#include "QinYiApp.h"

QY_ADAPTOR * g_pMtk;


U8 Tolower(U8 ch)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    if (ch >= 'A' && ch <= 'Z')
    {
        return (U8) (ch + ('a' - 'A'));
    }
    return ch;
}


S8 StrnCmp(S8 *s1, S8 *s2, int maxlen)
{
    /*----------------------------------------------------------------*/
    /* Local Variables                                                */
    /*----------------------------------------------------------------*/
    int ch1, ch2;

    /*----------------------------------------------------------------*/
    /* Code Body                                                      */
    /*----------------------------------------------------------------*/
    while (maxlen-- > 0)
    {
        ch1 = Tolower(*s1++);
        ch2 = Tolower(*s2++);
        if (ch1 > ch2)
        {
            return 1;
        }
        if (ch1 < ch2)
        {
            return -1;
        }
    }
    return 0;
}


